home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Cell Control / DATA1.CAB / VCDEMO_Files / CellStyleDlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-11  |  2.2 KB  |  88 lines

  1. // CellStyleDlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "VCDemo.h"
  6. #include "CellStyleDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCellStyleDlg dialog
  16.  
  17.  
  18. CCellStyleDlg::CCellStyleDlg(CWnd* pParent /*=NULL*/)
  19.     : CDialog(CCellStyleDlg::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CCellStyleDlg)
  22.         // NOTE: the ClassWizard will add member initialization here
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26.  
  27. void CCellStyleDlg::DoDataExchange(CDataExchange* pDX)
  28. {
  29.     CDialog::DoDataExchange(pDX);
  30.     //{{AFX_DATA_MAP(CCellStyleDlg)
  31.     DDX_Control(pDX, IDC_SGCTRL1, m_ctrl);
  32.     //}}AFX_DATA_MAP
  33. }
  34.  
  35.  
  36. BEGIN_MESSAGE_MAP(CCellStyleDlg, CDialog)
  37.     //{{AFX_MSG_MAP(CCellStyleDlg)
  38.     //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CCellStyleDlg message handlers
  43.  
  44. BOOL CCellStyleDlg::OnInitDialog() 
  45. {
  46.     CDialog::OnInitDialog();
  47.     
  48.     // TODO: Add extra initialization here
  49.     m_ctrl.DoSetCellString( 0,0, "Align left" );
  50.     m_ctrl.DoSetCellAlignment( 0, 0, 1 );
  51.     m_ctrl.DoSetCellString( 0,1, "Align right" );
  52.     m_ctrl.DoSetCellAlignment( 0, 1, 2 );
  53.     m_ctrl.DoSetCellString( 0,2, "Align medium" );
  54.     m_ctrl.DoSetCellAlignment( 0, 2, 4 );
  55.  
  56.     m_ctrl.DoSetCellString( 0,3, "Align top" );
  57.     m_ctrl.DoSetCellAlignment( 0, 3, 8 );
  58.     m_ctrl.DoSetCellString( 0,4, "Align bottom" );
  59.     m_ctrl.DoSetCellAlignment( 0, 4, 16 );
  60.     m_ctrl.DoSetCellString( 0,5, "Align v_medium" );
  61.     m_ctrl.DoSetCellAlignment( 0, 5, 32 );
  62.  
  63.     m_ctrl.DoSetCellString( 1, 0, "Word break" );
  64.     m_ctrl.DoSetCellTextStyle( 1, 0, 1 );
  65.     
  66.     
  67.     int i,j;
  68.  
  69.     for( i=0; i<6;i++)
  70.         m_ctrl.DoSetRowHeight( i, 50 );
  71.  
  72.     for( i = 1; i<5; i++)
  73.         for( j=3; j<6; j++)
  74.             m_ctrl.DoSetCell3DState(i, j, 1);
  75.     m_ctrl.DoSetCellString( 1, 3, "Form Head" );
  76.  
  77.     for( i = 1; i<5; i++)
  78.         for( j=8; j<12; j++)
  79.             m_ctrl.DoSetCell3DState(i, j, 2);
  80.  
  81.     m_ctrl.SetPageLabelVisible( FALSE );
  82.     COleVariant var( "VCDEMO" );
  83.     m_ctrl.DoSetMessageTitle( var );
  84.  
  85.     return TRUE;  // return TRUE unless you set the focus to a control
  86.                   // EXCEPTION: OCX Property Pages should return FALSE
  87. }
  88.